﻿@model Model.AppUserList
@{
    ViewBag.Title = "用户库位关联管理";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@section JQscriptSection{
    <script src="../../Scripts/viewsScript/UserCell/UserCellC.js" type="text/javascript"></script>
    <script src="../../Scripts/viewsScript/Common/MyDialog.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
            function ExporterExcel() {
                var form = $('#query');
                var rows = $(".pagination-page-list option:selected").text();
                var page = $("input[size='2']").val();
                form.form('submit', {
                    url: '@Url.Content("~/UserCell/ExportExcel")' + '?page=' + page + '&rows=' + rows,
                    success: function (data) {
                        eval('data=' + data);
                        if (data.success) {
                            InitGrid();
                        } else {
                            $.messager.alert('错误', data.msg, 'error');
                        }
                    }
                });
            };
            function Import() {
                var form = $('#import');
                form.form('submit', {
                    url: '/UserCell/Import',
                success: function (data) {
                    eval('data=' + data);
                    if (data.success) {
                        InitGrid();
                    } else {
                        $.messager.alert('错误', data.msg, 'error');
                    }
                }
            });
        };
    </script>
}
<body style="background-color: ButtonFace; font-size: 17px" @*onload="InitGrid();"*@>

    <div id="p2" class="easyui-panel" title="查询条件" style="height: 100px; padding: 5px; background: #fafafa;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>用户:
                    </td>
                    <td>
                        <input id="txtSUSERNAME" name="txtSUSERNAME" style="width: 154px" />
                    </td>
                    <td>库位:
                    </td>
                    <td>
                        <input id="txtSCELLNO" name="txtSCELLNO" style="width: 154px" />
                    </td>
                    <td></td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                    </td>

                </tr>
            </table>
        </form>
        <form id="import" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <td>
                        <input id="FileUpload" type="file" name="files" style="width: 250px; height: 24px; background: White"
                            class="easyui-validatebox" />
                        <a id="btnImport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-upload'" onclick="Import()">导入</a>
                    </td>
                    <td>
                        <a id="btnExecl" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onclick="ExporterExcel()">导出</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div>
        <table id="tab_list">
        </table>
    </div>
    <div id="p1" class="easyui-dialog" style="width: 650px; height: 240px; padding: 10px 20px" closed="true" buttons="#dlg-buttons">
        <form id="location" method="post">
            <table>
                <tr>
                    <td>登录名:
                    </td>
                    <td>
                        <input id="hiddenUSERCELLID" name="hiddenUSERCELLID" type="hidden" />
                        <select id="UserCode" class="easyui-combogrid" name="UserCode" style="width: 250px;"
                            data-options="
                            defaulttext:'',
                        idField:'USERID',
                        textField:'USERCODE',
                        url:'@Url.Content("/BaseData/UserList")',
                        columns:[[
                            {field:'USERCODE',title:'登录名',width:100},
                            {field:'USERNAME',title:'用户名',width:130}
                        ]]
                    ">
                        </select>
                    </td>
                    <td>库位:
                    </td>
                    <td colspan="2">
                        <select id="CellNo" class="easyui-combogrid" name="CellNo" style="width: 154px;"
                            data-options="
                        idField:'CELLNO',
                        textField:'CELLNO',
                        url:'@Url.Content("/BaseData/CellNoList")',
                        columns:[[
                            {field:'CELLNO',title:'库位',width:120}
                        ]]
                    ">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>备注:
                    </td>
                    <td colspan="4">
                        <input id="txtRemark" name="txtRemark" maxlength="255" style="width: 520px" />
                    </td>
                </tr>

                <tr>
                    <td colspan="5">
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="save()">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

</body>
